#!/usr/bin/env python

PACKAGE = "sagittarius_object_color_detector"

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

gen.add("HSV_Enable", bool_t, 0, "Output HSV Filter", True)
group1 = gen.add_group("HSV Params", state = True)
group1.add("H_Max", int_t, 0, "Hue Max", 360, 0, 360)
group1.add("H_Min", int_t, 0, "Hue Min", 0, 0, 360)
group1.add("S_Max", int_t, 0, "Saturation Max", 255, 0, 255)
group1.add("S_Min", int_t, 0, "Saturation Min", 0, 0, 255)
group1.add("V_Max", int_t, 0, "Value Max", 255, 0, 255)
group1.add("V_Min", int_t, 0, "Value Min", 0, 0, 255)
group1_2 = group1.add_group("red Hue Extension", type="collapse", state=False)
group1_2.add("H_Extend", int_t, 0,  '''The range of red Hue includes two areas: 0~60 and 300~360. '''\
                                    '''Extending 0~60 can cover red more completely. '''\
                                    '''After the extension, the default maximum value of Hue is 360.'''\
                                    '''Enable only in red type.''', 0, 0, 60)

color_type_enum = gen.enum([
    gen.const("blue", int_t, 0, ""),
    gen.const("green", int_t, 1, ""),
    gen.const("red", int_t, 2, ""),
    gen.const("customize", int_t, 3, ""),
], "color type")
gen.add("color_type", int_t, 0, "Cube Color", edit_method=color_type_enum)

exit(gen.generate(PACKAGE, "sagittarius_object_color_detector_configure", "HSVParams"))